package com.slowfly.rule.engine.features.field;


import com.alibaba.fastjson.JSON;
import com.slowfly.rule.engine.annotations.FeatureClass;
import com.slowfly.rule.engine.entity.Feature;
import com.slowfly.rule.engine.features.BaseFeatureClass;
import com.slowfly.rule.engine.param.ListFeaturesParam;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@FeatureClass(code = "field_feature_class", name = "字段特征")
public class FieldFeatureClass extends BaseFeatureClass {

    public Object getFeatureValue(ListFeaturesParam param, Feature feature) {
        Object featureValue = getFeatureValue(param.getRiskParam(), feature.getParam());
        Object value = convertFeatureType(featureValue, feature.getType());
        log.info("getFeatureValue {} {} {}", JSON.toJSON(param), JSON.toJSON(feature), value);
        return value;
    }
}


